package com.sw.paisong.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import com.sw.paisong.vo.StaffFormVO;

@Entity
@Table(name = "tb_staffs")
public class StaffEntity {

	@Id
	@Column(length = 32)
	private String id;
	@Column(length = 20)
	private String num;
	@Column(length = 10)
	private String name;
	@Column(length = 20)
	private String phone;
	@Column(length = 20, name = "v_phone")
	private String vPhone;
	@Column(length = 500)
	private String remarks;
	@JSONField(serialize = false)
	@Column(name = "create_at")
	private Date createAt;
	@JSONField(serialize = false)
	@Column(name = "update_at")
	private Date updateAt;
	@JSONField(serialize = false)
	@Column(name = "create_by", length = 32)
	private String createBy;
	@JSONField(serialize = false)
	@Column(name = "update_by", length = 32)
	private String updateBy;
	@OneToMany(mappedBy = "staff")
	private Set<PosRecordEntity> posRecords = new HashSet<PosRecordEntity>();

	public StaffEntity() {

	}

	public StaffEntity(StaffFormVO staffFormVO) {
		this.id = staffFormVO.getStaffId();
		this.num = staffFormVO.getStaffNum();
		this.name = staffFormVO.getStaffName();
		this.phone = staffFormVO.getStaffPhone();
		this.vPhone = staffFormVO.getStaffVPhone();
		this.remarks = staffFormVO.getStaffRemarks();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getVPhone() {
		return vPhone;
	}

	public void setVPhone(String vPhone) {
		this.vPhone = vPhone;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Date getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}

	public Date getUpdateAt() {
		return updateAt;
	}

	public void setUpdateAt(Date updateAt) {
		this.updateAt = updateAt;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	public Set<PosRecordEntity> getPosRecords() {
		return posRecords;
	}

	public void setPosRecords(Set<PosRecordEntity> posRecords) {
		this.posRecords = posRecords;
	}

}
